package com.xrtn.service.impl;

import com.xrtn.bean.InitAdvert;
import com.xrtn.mapper.InitAdvertMapper;
import com.xrtn.service.ISysAdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysAdServiceImpl implements ISysAdService {

    /**
     * 系统广告表
     */
    @Autowired
    private InitAdvertMapper adMapper;


    @Override
    public int insertAd(InitAdvert ad) {
        adMapper.insertSelective(ad);
        return ad.getAdId();
    }

    @Override
    public int updateAd(InitAdvert ad) {
        adMapper.updateByPrimaryKeySelective(ad);
        return ad.getAdId();
    }

    @Override
    public List<InitAdvert> selectAdBySubclinicId(Integer subclinicId) {
        return adMapper.selectBySubclinicId(subclinicId);
    }
}
